import 'package:shared_preferences/shared_preferences.dart';

class SharedPreferencesHelper {
  final String _counterKey;

  SharedPreferencesHelper(this._counterKey);

  // 存储整数
  Future<void> saveDouble(double value) async {
    SharedPreferences prefs = await SharedPreferences.getInstance();
    await prefs.setDouble(_counterKey, value);
  }

  // 读取整数
  Future<double?> getDouble() async{
    SharedPreferences prefs = await SharedPreferences.getInstance();
    return prefs.getDouble(_counterKey);
  }

}

